<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'status0';
$return=array();
if($_RQ['op']=='status0'){
	$pindex = max(1, intval($_SESSION['page']));
	$psize = 10;
	$params=array('uniacid'=>$_SESSION['uniacid'],'status'=>0);
   // $fields=array('id','catename','status','displayorder');
    $orderby='id desc';
	$total='';
	$return['list']=pdo_getslice('jy_cashier_clearing',$params,array($pindex,$psize),$total,$fields,'',$orderby);
	$return['status']=array('0'=>'待审核','1'=>'待结算','2'=>'已结算');
	$return['paytype']=array('1'=>'微信支付','2'=>'支付宝支付');
	foreach($return['list'] as &$v){
		$v['createtime']=date('Y-m-d H:i:s',$v['createtime']);
	}
	$htmls=array(
		'type'=>'list',
		'tabs'=>array(
			array('op'=>'list','title'=>'结算列表'),
			
		),
		'list'=>array('data'=>'list','list'=>array(
			array('name'=>'clearno','title'=>'结算编号','type'=>'string'),
			array('name'=>'createtime','title'=>'申请时间','type'=>'string'),			
			array('name'=>'money','title'=>'申请金额','type'=>'string'),
			array('name'=>'status','title'=>'状态','type'=>'radio','options'=>'status'),						
		)),
	);
	$return['htmls']=$htmls;
	
	exi($return);
}

if($_RQ['op']=='status1'){
	$pindex = max(1, intval($_SESSION['page']));
	$psize = 10;
	$params=array('uniacid'=>$_SESSION['uniacid'],'status'=>1);
   // $fields=array('id','catename','status','displayorder');
    $orderby='id desc';
	$total='';
	$return['list']=pdo_getslice('jy_cashier_clearing',$params,array($pindex,$psize),$total,$fields,'',$orderby);
	$return['status']=array('0'=>'待审核','1'=>'待结算','2'=>'已结算');
	$return['paytype']=array('1'=>'微信支付','2'=>'支付宝支付');
	foreach($return['list'] as &$v){	
		$v['createtime']=date('Y-m-d H:i:s',$v['createtime']);	
	}
	$htmls=array(
		'type'=>'list',
		'tabs'=>array(
			array('op'=>'list','title'=>'结算列表'),
			
		),
		'list'=>array('data'=>'list','list'=>array(
			
			array('name'=>'clearno','title'=>'结算编号','type'=>'string'),
			array('name'=>'createtime','title'=>'申请时间','type'=>'string'),
			
			array('name'=>'money','title'=>'申请金额','type'=>'string'),
			array('name'=>'status','title'=>'状态','type'=>'radio','options'=>'status'),	
					
		)),
	);
	$return['htmls']=$htmls;
	
	exi($return);
}

if($_RQ['op']=='status2'){
	$pindex = max(1, intval($_SESSION['page']));
	$psize = 10;
	$params=array('uniacid'=>$_SESSION['uniacid'],'status'=>2);
   // $fields=array('id','catename','status','displayorder');
    $orderby='id desc';
	$total='';
	$return['list']=pdo_getslice('jy_cashier_clearing',$params,array($pindex,$psize),$total,$fields,'',$orderby);
	$return['status']=array('0'=>'待审核','1'=>'待结算','2'=>'已结算');
	$return['paytype']=array('1'=>'微信支付','2'=>'支付宝支付');
	foreach($return['list'] as &$v){	
		$v['createtime']=date('Y-m-d H:i:s',$v['createtime']);
	}
	$htmls=array(
		'type'=>'list',
		'tabs'=>array(
			array('op'=>'list','title'=>'结算列表'),
			
		),
		'list'=>array('data'=>'list','list'=>array(
			
			array('name'=>'clearno','title'=>'结算编号','type'=>'string'),
			array('name'=>'createtime','title'=>'申请时间','type'=>'string'),
			
			array('name'=>'money','title'=>'申请金额','type'=>'string'),
			array('name'=>'status','title'=>'状态','type'=>'radio','options'=>'status'),	
					
		)),
	);
	$return['htmls']=$htmls;	
	exi($return);
}